def trim(s):
    if s[0] == ' ':
        s = trim(s[1:])
    elif s[-1] == ' ':
        s = trim(s[:-1])
    return s

print('==',trim('hehe'),'==')